﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CommonHelpers
{
    public class GeneralHelper
    {
        public static int RoundMoney(decimal d)
        {
            decimal temp = ((decimal)d) / 1000;
            int i = (int)(Math.Round(temp) * 1000);
            return i;
        }

        public static int RoundUpMoney(decimal d, ref decimal tienThuaTraLai)
        {
            decimal temp = ((decimal)d) / 1000;
            int upMoney = (int)(Math.Ceiling(temp) * 1000);
            int downMoney = (int)(Math.Floor(temp) * 1000);
            tienThuaTraLai = d - downMoney;
            return upMoney;
        }
    }
}
